package com.sx.baseproject.framework.net;

import com.sx.baseproject.framework.net.local.LocalHttpModel;

/**
 * @Description
 * @Author dogeWen
 * @Date 2021/5/8 12:40
 */
public class HttpManager {
    public static HttpModel httpModel;
    public static HttpModel localHttpModel;

    public static HttpModel getInstance(boolean debug) {
        if (!debug) {
            if (httpModel == null) {
                synchronized (HttpModel.class) {
                    if (httpModel == null) {
                        httpModel = new HttpModelImpl();
                    }
                }
            }
            return httpModel;
        } else {
            if (localHttpModel == null) {
                synchronized (HttpModel.class) {
                    if (localHttpModel == null) {
                        localHttpModel = new LocalHttpModel();
                    }
                }
            }
            return localHttpModel;
        }

    }
}
